<?php
session_start();
require_once('config/core.php');

if(!isset($_GET['page']) OR empty($_GET['page']) OR !ctype_alpha($_GET['page']) OR !file_exists('controllers'.DS.$_GET['page'].'Controller.php'))
    $page = 'Index';
else
    $page = ucfirst($_GET['page']);
	
$page .= 'Controller';


if(!isset($_GET['action']) OR empty($_GET['action']) OR !ctype_alpha($_GET['action']) OR !in_array($_GET['action'], get_class_methods($page)))
	$action = 'index';
else
	$action = $_GET['action'];


$display = new $page();
$display->$action();

?>